home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 February: Tool Chest / Apple Developer CD Series Tool Chest February 1996 (Apple Computer)(1996).iso / Tool Chest / Interfaces & Libraries / Interfaces / AIncludes / Quickdraw.a < prev    next >
Encoding:
Text File  |  1993-11-30  |  31.4 KB  |  825 lines  |  [TEXT/MPS ]

  1. ;    File:        Quickdraw.a
  2. ;
  3. ;    Copyright:    © 1983-1993 by Apple Computer, Inc.
  4. ;                All rights reserved.
  5. ;
  6. ;    Version:    System 7.1• for ETO #13
  7. ;    Created:    Tuesday, March 30, 1993 18:00
  8. ;    Modified:    Tue, Nov 30, 1993 11:37:47
  9. ;
  10. ;___________________________________________________________________________
  11.  
  12.     IF &TYPE('__INCLUDINGQUICKDRAW__') = 'UNDEFINED' THEN
  13. __INCLUDINGQUICKDRAW__    SET    1
  14.  
  15.     IF &TYPE('__INCLUDINGSYSEQU__') = 'UNDEFINED' THEN
  16.  INCLUDE 'SysEqu.a'
  17.      ENDIF
  18.  
  19. ; Transfer modes
  20.  
  21. srcCopy           EQU         0
  22. srcOr             EQU         1
  23. srcXor            EQU         2
  24. srcBic            EQU         3
  25. notSrcCopy        EQU         4
  26. notSrcOr          EQU         5
  27. notSrcXor         EQU         6
  28. notSrcBic         EQU         7
  29. patCopy           EQU         8
  30. patOr             EQU         9
  31. patXor            EQU         10
  32. patBic            EQU         11
  33. notPatCopy        EQU         12
  34. notPatOr          EQU         13
  35. notPatXor         EQU         14
  36. notPatBic         EQU         15
  37.  
  38. ; Arithmetic transfer modes
  39. blend             EQU         32
  40. addPin            EQU         33
  41. addOver           EQU         34
  42. subPin            EQU         35
  43. adMax             EQU         37
  44. subOver           EQU         38
  45. adMin             EQU         39
  46.  
  47. ; Special text mode
  48. grayishTextOr    EQU            49
  49.  
  50. ditherCopy        EQU            64                        ;promote source to 32-bit and then dither down
  51.  
  52. ; Flags passed to DeviceLoop
  53.  
  54. singleDevicesBit    EQU        0
  55. dontMatchSeedsBit    EQU        1
  56. allDevicesBit        EQU        2
  57.  
  58. singleDevices        EQU        1
  59. dontMatchSeeds        EQU        2
  60. allDevices            EQU        4
  61.  
  62. ; Definitions for Font Style Bits (right to left)
  63.  
  64. boldBit           EQU         0
  65.  
  66. ; Transparent mode constant
  67. transparent       EQU         36
  68. italicBit         EQU         1
  69. ulineBit          EQU         2
  70. outlineBit        EQU         3
  71. shadowBit         EQU         4
  72. condenseBit       EQU         5
  73. extendBit         EQU         6
  74.  
  75.  
  76. ; FontInfo record
  77.  
  78. ascent            EQU         0                         ; ascent [word]
  79. descent           EQU         2                         ; descent [word]
  80. widMax            EQU         4                         ; maximum width [word]
  81. leading           EQU         6                         ; leading [word]
  82.  
  83. FontInfo             RECORD  0
  84. ascent               DS.W    1            ; short
  85. descent              DS.W    1            ; short
  86. widMax               DS.W    1            ; short
  87. leading              DS.W    1            ; short
  88. size                 EQU     *
  89.                      ENDR
  90.  
  91.  
  92. ; Point structure
  93.  
  94. v                 EQU         0                         ; vertical coordinate [word]
  95. h                 EQU         2                         ; horizontal coordinate [word]
  96.  
  97.  
  98. ; Rectangle structure
  99.  
  100. topLeft           EQU         0                         ; upper left corner [point]
  101. botRight          EQU         4                         ; lower right corner [point]
  102. top               EQU         0                         ; top coordinate [word]
  103. left              EQU         2                         ; left coordinate [word]
  104. bottom            EQU         4                         ; bottom coordinate [word]
  105. right             EQU         6                         ; right coordinate [word]
  106.  
  107. ; Bitmap Structure
  108.  
  109. baseAddr          EQU         0                         ; bitmap base address [pointer]
  110. rowBytes          EQU         4                         ; row bytes (must be even) [word]
  111. bounds            EQU         6                         ; bounding box [rectangle]
  112. bitmapRec         EQU         14                        ; size of a bitmap
  113.  
  114. BitMapRecord         RECORD  0
  115. baseAddr             DS.L    1            ; Ptr
  116. rowBytes             DS.W    1            ; short
  117. bounds               DS      Rect
  118. size                 EQU     *
  119.                      ENDR
  120.  
  121.  
  122. ; Cursor Structure
  123.  
  124. data              EQU         0                         ; visible bits [32 bytes]
  125. mask              EQU         $20                       ; mask bits [32 bytes]
  126. hotSpot           EQU         $40                       ; relative origin [point]
  127. cursRec           EQU         68                        ; size of a cursor
  128.  
  129. Cursor               RECORD  0
  130. data                 DS.B    32           ; Bits16
  131. mask                 DS.B    32           ; Bits16
  132. hotSpot              DS      Point
  133. size                 EQU     *
  134.                      ENDR
  135.  
  136.  
  137. ; PenState record
  138.  
  139. psLoc             EQU         0                         ; pen location [point]
  140. psSize            EQU         4                         ; pen size [point]
  141. psMode            EQU         8                         ; pen mode [word]
  142. psPat             EQU         10                        ; pen [pattern]
  143. psRec             EQU         18                        ; size of pen state
  144.  
  145. PenState             RECORD  0
  146. pnLoc                DS      Point
  147. pnSize               DS      Point
  148. pnMode               DS.W    1            ; short
  149. pnPat                DS.B    8            ; Pattern
  150. size                 EQU     *
  151.                      ENDR
  152.  
  153.  
  154. ; Polygon record
  155.  
  156. polySize          EQU         0                         ; total bytes [word]
  157. polyBBox          EQU         2                         ; bounding box [rectangle]
  158. polyPoints        EQU         10                        ; vertices [Points]
  159.  
  160. Polygon              RECORD  0
  161. polySize             DS.W    1            ; short
  162. polyBBox             DS      Rect
  163. polyPoints           DS.B    Point.size*1
  164. size                 EQU     *
  165.                      ENDR
  166.  
  167.  
  168. ; Region Structure
  169.  
  170. rgnSize           EQU         0                         ; total bytes [word]
  171. rgnBBox           EQU         2                         ; bounding box [rectangle]
  172. rgnData           EQU         10                        ; region data [array]
  173.  
  174. Region               RECORD  0
  175. rgnSize              DS.W    1            ; short: size in bytes
  176. rgnBBox              DS      Rect         ;enclosing rectangle
  177. size                 EQU     *
  178.                      ENDR
  179.  
  180.  
  181. ; Picture Structure
  182.  
  183. picSize           EQU         0                         ; total bytes [word]
  184. picFrame          EQU         2                         ; bounding box [rectangle]
  185. picData           EQU         10                        ; picture byte codes [array]
  186.  
  187. Picture              RECORD  0
  188. picSize              DS.W    1            ; short
  189. picFrame             DS      Rect
  190. size                 EQU     *
  191.                      ENDR
  192.  
  193.  
  194. OpenCPicParams    RECORD    0
  195. srcRect        ds.w    4
  196. hRes        ds.l    1
  197. vRes        ds.l    1
  198. version        ds.w    1
  199. reserved1    ds.w    1
  200. reserved2    ds.l    1
  201.             ENDR
  202.             
  203. ; QDProcs structure
  204.  
  205. textProc          EQU         0                         ; [pointer]
  206. lineProc          EQU         4                         ; [pointer]
  207. rectProc          EQU         8                         ; [pointer]
  208. rRectProc         EQU         $C                        ; [pointer]
  209. ovalProc          EQU         $10                       ; [pointer]
  210. arcProc           EQU         $14                       ; [pointer]
  211. polyProc          EQU         $18                       ; [pointer]
  212. rgnProc           EQU         $1C                       ; [pointer]
  213. bitsProc          EQU         $20                       ; [pointer]
  214. commentProc       EQU         $24                       ; [pointer]
  215. txMeasProc        EQU         $28                       ; [pointer]
  216. getPicProc        EQU         $2C                       ; [pointer]
  217. putPicProc        EQU         $30                       ; [pointer]
  218. qdProcsRec        EQU         $34                       ; size of QDProcs record
  219.  
  220. QDProcs              RECORD  0
  221. textProc             DS.L    1            ; Ptr
  222. lineProc             DS.L    1            ; Ptr
  223. rectProc             DS.L    1            ; Ptr
  224. rRectProc            DS.L    1            ; Ptr
  225. ovalProc             DS.L    1            ; Ptr
  226. arcProc              DS.L    1            ; Ptr
  227. polyProc             DS.L    1            ; Ptr
  228. rgnProc              DS.L    1            ; Ptr
  229. bitsProc             DS.L    1            ; Ptr
  230. commentProc          DS.L    1            ; Ptr
  231. txMeasProc           DS.L    1            ; Ptr
  232. getPicProc           DS.L    1            ; Ptr
  233. putPicProc           DS.L    1            ; Ptr
  234. size                 EQU     *
  235.                      ENDR
  236.  
  237.  
  238. ; GrafPort Structure
  239.  
  240. device            EQU         $0                        ; device code [word]
  241. portBits          EQU         $2                        ; port's bitmap [bitmap]
  242. portBounds        EQU         $8                        ; bounding box of bitmap [rect]
  243. portRect          EQU         $10                       ; port's rectangle [rect]
  244. visRgn            EQU         $18                       ; visible region [handle]
  245. clipRgn           EQU         $1C                       ; clipping region [handle]
  246. bkPat             EQU         $20                       ; background [pattern]
  247. fillPat           EQU         $28                       ; fill [pattern]
  248. pnLoc             EQU         $30                       ; pen location [point]
  249. pnSize            EQU         $34                       ; pen size [point]
  250. pnMode            EQU         $38                       ; pen mode [word]
  251. pnPat             EQU         $3A                       ; pen [pattern]
  252. pnVis             EQU         $42                       ; pen visible [word]
  253. txFont            EQU         $44                       ; text font [word]
  254. txFace            EQU         $46                       ; text face [word]
  255. txMode            EQU         $48                       ; text mode [word]
  256. txSize            EQU         $4A                       ; text size [word]
  257. spExtra           EQU         $4C                       ; space extra [fixed]
  258. fgColor           EQU         $50                       ; foreground color mask [long]
  259. bkColor           EQU         $54                       ; background color mask [long]
  260. colrBit           EQU         $58                       ; color bit [word]
  261. patStretch        EQU         $5A                       ; pattern stretch [word]
  262. picSave           EQU         $5C                       ; picture being saved [handle]
  263. rgnSave           EQU         $60                       ; region being saved [handle]
  264. polySave          EQU         $64                       ; polygon being saved [handle]
  265. grafProcs         EQU         $68                       ; QDProcs array [pointer]
  266. portRec           EQU         $6C                       ; size of grafport
  267.  
  268. GrafPort             RECORD  0
  269. device               DS.W    1            ; short
  270. portBits             DS      BitMapRecord
  271. portRect             DS      Rect
  272. visRgn               DS.L    1            ; RgnHandle
  273. clipRgn              DS.L    1            ; RgnHandle
  274. bkPat                DS.B    8            ; Pattern
  275. fillPat              DS.B    8            ; Pattern
  276. pnLoc                DS      Point
  277. pnSize               DS      Point
  278. pnMode               DS.W    1            ; short
  279. pnPat                DS.B    8            ; Pattern
  280. pnVis                DS.W    1            ; short
  281. txFont               DS.W    1            ; short
  282. txFace               DS.B    1            ; Style: txFace is unpacked byte but push as short
  283. filler               DS.B    1            ; Byte
  284. txMode               DS.W    1            ; short
  285. txSize               DS.W    1            ; short
  286. spExtra              DS.L    1            ; Fixed
  287. fgColor              DS.L    1            ; long
  288. bkColor              DS.L    1            ; long
  289. colrBit              DS.W    1            ; short
  290. patStretch           DS.W    1            ; short
  291. picSave              DS.L    1            ; Handle
  292. rgnSave              DS.L    1            ; Handle
  293. polySave             DS.L    1            ; Handle
  294. grafProcs            DS.L    1            ; QDProcsPtr
  295. size                 EQU     *
  296.                      ENDR
  297.  
  298.  
  299. ; QuickDraw Global Variables
  300.  
  301.  
  302. GrafGlobals       EQU         0                         ; A5 offset to globptr
  303. thePort           EQU         0                         ;GrafPtr
  304. white             EQU         thePort-8                 ;Pattern
  305. black             EQU         white-8                   ;Pattern
  306. gray              EQU         black-8                   ;Pattern
  307. ltGray            EQU         gray-8                    ;Pattern
  308. dkGray            EQU         ltGray-8                  ;Pattern
  309. arrow             EQU         dkGray-68                 ;Cursor
  310. screenBits        EQU         arrow-14                  ;BitMap
  311. randSeed          EQU         screenBits-4              ;LONGINT
  312.  
  313. ; color manager equates
  314.  
  315. ; RGBColor structure
  316.  
  317. red               EQU         $0                        ;red channel intensity [short]
  318. green             EQU         $2                        ;green channel intensity[short]
  319. blue              EQU         $4                        ;blue channel intensity [short]
  320. rgbColor          EQU         $6                        ;size of record
  321.  
  322. RGBColorRec          RECORD  6,DECREMENT
  323. size                 EQU     *
  324. blue                 DS.W    1            ;magnitude of blue component
  325. green                DS.W    1            ;magnitude of green component
  326. red                  DS.W    1            ;magnitude of red component
  327.                      ENDR
  328.  
  329. ; ColorSpec structure
  330.  
  331. value             EQU         $0                        ;value field [short]
  332. rgb               EQU         $2                        ;rgb values [rgbColor]
  333. colorSpecSize     EQU         $8                        ;size of record
  334.  
  335. ColorSpec            RECORD  0
  336. value                DS.W    1            ; short: index or other value
  337. rgb                  DS      RGBColorRec  ;true color
  338. size                 EQU     *
  339.                      ENDR
  340.  
  341.  
  342. ; MatchRec structure
  343.  
  344. ;red EQU $0 ;defined in RGBColor
  345. ;green EQU $2 ;defined in RGBColor
  346. ;blue EQU $4 ;defined in RGBColor
  347. matchData         EQU         $6                        ; [long]
  348. matchRecSize      EQU         $A
  349.  
  350. MatchRec             RECORD  0
  351. red                  DS.W    1            ; short
  352. green                DS.W    1            ; short
  353. blue                 DS.W    1            ; short
  354. matchData            DS.L    1            ; long
  355. size                 EQU     *
  356.                      ENDR
  357.  
  358.  
  359. ; Color Separation
  360.  
  361. normalBit         EQU         0                         ; normal screen mapping
  362. inverseBit        EQU         1                         ; inverse screen mapping
  363. redBit            EQU         4                         ; RGB additive mapping
  364. greenBit          EQU         3                         ; for photos from screen
  365. blueBit           EQU         2
  366. cyanBit           EQU         8                         ; CMYBk subtractive mapping
  367. yellowBit         EQU         6
  368. magentaBit        EQU         7                         ; for ink jet printer
  369. blackBit          EQU         5
  370. blackColor        EQU         33
  371. whiteColor        EQU         30
  372. redColor          EQU         205
  373. greenColor        EQU         341
  374. blueColor         EQU         409
  375. cyanColor         EQU         273
  376. magentaColor      EQU         137
  377. yellowColor       EQU         69
  378.  
  379.  
  380. ; Standard Picture Comments
  381.  
  382. picLParen         EQU         0
  383. picRParen         EQU         1
  384.  
  385. ; QuickDraw verbs
  386.  
  387. frame             EQU         0
  388. paint             EQU         1
  389. erase             EQU         2
  390. invert            EQU         3
  391. fill              EQU         4
  392.  
  393. ; QuickDraw private global variables
  394.  
  395. wideOpen          EQU         randSeed-4                ;RgnHandle
  396. wideMaster        EQU         wideOpen-4                ;RgnPtr
  397. wideData          EQU         wideMaster-10             ;Fake Region
  398. rgnBuf            EQU         wideData-4                ;PointsHandle
  399. rgnIndex          EQU         rgnBuf-2                  ;INTEGER
  400. rgnMax            EQU         rgnIndex-2                ;INTEGER
  401. playPic           EQU         rgnMax-4                  ;Long
  402. qdSpare0          EQU         playPic-2                 ;unused word
  403. thePoly           EQU         qdSpare0-4                ;POLYHANDLE
  404. polyMax           EQU         thePoly-2                 ;INTEGER
  405. patAlign          EQU         polyMax-4                 ;Point
  406. fontAdj           EQU         patAlign-4                ;Fixed Point
  407. fontPtr           EQU         fontAdj-4                 ;long, ^FMOutput record
  408. playIndex         EQU         fontPtr-4                 ;long
  409. pnLocFixed        EQU            playIndex-2                ;word, horizontal pen fraction            <9>
  410. qdRunSlop        EQU         pnLocFixed-4            ;fixed point, Script Mgr run slop        <11><13>
  411. qdChExtra        EQU         qdRunSlop-4                ;fixed point, Script Mgr char extra        <11><13>
  412. fontData          EQU         qdChExtra-12            ;unused words                            <9><11><13>
  413. lastGrafGlob      EQU         fontData
  414. grafSize          EQU         4-lastGrafGlob            ;total size in bytes
  415.  
  416. ; A record version of the Quickdraw globals
  417. ; It is here rather than with the complementary equates because it needs other equates
  418. ; ...(bitmapRec, grafSize, cursRec)
  419.  
  420. QDGlobals         RECORD      0,DECREMENT
  421. thePort           DS.L        1
  422. white             DS.B        8
  423. black             DS.B        8
  424. gray              DS.B        8
  425. ltGray            DS.B        8
  426. dkGray            DS.B        8
  427. arrow             DS.B        cursRec
  428. screenBits        DS.B        bitmapRec
  429. randSeed          DS.L        1
  430.                   ORG         -grafSize
  431.                   ENDR
  432.  
  433.  
  434. ;************** FROM HERE TO THE ENDIF IS ALL THE NEW STUFF FOR COLOR QUICKDRAW *************
  435.  
  436. hiliteBit         EQU         7                         ; flag bit in HiliteMode (lowMem flag)
  437.  
  438. ; Equates for resource ID's
  439.  
  440. defQDColors       EQU         127                       ; resource ID of clut for default QDColors
  441.  
  442. ;
  443. ; PixMap field offsets
  444.  
  445. pmBaseAddr        EQU         $0                        ; [long]
  446. pmNewFlag         EQU         $4                        ; [1 bit] upper bit of rowbytes is flag
  447. pmRowBytes        EQU         $4                        ; [word]
  448. pmBounds          EQU         $6                        ; [rect]
  449. pmVersion         EQU         $E                        ; [word] pixMap version number
  450. pmPackType        EQU         $10                       ; [word] defines packing format
  451. pmPackSize        EQU         $12                       ; [long] size of pixel data
  452. pmHRes            EQU         $16                       ; [fixed] h. resolution (ppi)
  453. pmVRes            EQU         $1A                       ; [fixed] v. resolution (ppi)
  454. pmPixelType       EQU         $1E                       ; [word] defines pixel type
  455. pmPixelSize       EQU         $20                       ; [word] # bits in pixel
  456. pmCmpCount        EQU         $22                       ; [word] # components in pixel
  457. pmCmpSize         EQU         $24                       ; [word] # bits per field
  458. pmPlaneBytes      EQU         $26                       ; [long] offset to next plane
  459. pmTable           EQU         $2A                       ; [long] color map
  460. pmReserved        EQU         $2E                       ; [long] MUST BE 0
  461. pmRec             EQU         $32                       ; size of pixMap record
  462.  
  463. PixMap               RECORD  0
  464. baseAddr             DS.L    1            ; Ptr: pointer to pixels
  465. rowBytes             DS.W    1            ; short: offset to next line
  466. bounds               DS      Rect         ;encloses bitmap
  467. pmVersion            DS.W    1            ; short: pixMap version number
  468. packType             DS.W    1            ; short: defines packing format
  469. packSize             DS.L    1            ; long: length of pixel data
  470. hRes                 DS.L    1            ; Fixed: horiz. resolution (ppi)
  471. vRes                 DS.L    1            ; Fixed: vert. resolution (ppi)
  472. pixelType            DS.W    1            ; short: defines pixel type
  473. pixelSize            DS.W    1            ; short: # bits in pixel
  474. cmpCount             DS.W    1            ; short: # components in pixel
  475. cmpSize              DS.W    1            ; short: # bits per component
  476. planeBytes           DS.L    1            ; long: offset to next plane
  477. pmTable              DS.L    1            ; CTabHandle: color map for this pixMap
  478. pmReserved           DS.L    1            ; long: for future use. MUST BE 0
  479. size                 EQU     *
  480.                      ENDR
  481.  
  482.  
  483. ; pixel types
  484.  
  485. chunky            EQU         0
  486. chunkyPlanar      EQU         1
  487. planar            EQU         2
  488. RGBDirect        EQU            16
  489.  
  490. ;
  491. ; pmVersion values
  492.  
  493. baseAddr32        EQU            4                        ; pixmap base address is 32-bit address
  494.  
  495. ; PixPat field offsets
  496. ;
  497.  
  498. patType           EQU         $0                        ; [word] type of pattern
  499. patMap            EQU         $2                        ; [long] handle to pixmap
  500. patData           EQU         $6                        ; [long] handle to data
  501. patXData          EQU         $A                        ; [long] handle to expanded pattern data
  502. patXValid         EQU         $E                        ; [word] flags whether expanded pattern valid
  503. patXMap           EQU         $10                       ; [long] handle to expanded pattern data
  504. pat1Data          EQU         $14                       ; [8 bytes] old-style pattern/RGB color
  505. ppRec             EQU         $1C                       ; size of pixPat record
  506.  
  507.  
  508. PixPat               RECORD  0
  509. patType              DS.W    1            ; short: type of pattern
  510. patMap               DS.L    1            ; PixMapHandle: the pattern's pixMap
  511. patData              DS.L    1            ; Handle: pixmap's data
  512. patXData             DS.L    1            ; Handle: expanded Pattern data
  513. patXValid            DS.W    1            ; short: flags whether expanded Pattern valid
  514. patXMap              DS.L    1            ; Handle: Handle to expanded Pattern data
  515. pat1Data             DS.B    8            ; Pattern: old-Style pattern/RGB color
  516. size                 EQU     *
  517.                      ENDR
  518.  
  519.  
  520. ; Pattern types
  521. ;
  522.  
  523. oldPat            EQU         0                         ; foreground/background pattern
  524. newPat            EQU         1                         ; self-contained color pattern
  525. ditherPat         EQU         2                         ; rgb value to be dithered
  526. oldCrsrPat        EQU         $8000                     ; old-style cursor
  527. cCrsrPat          EQU         $8001                     ; new-style cursor
  528.  
  529.  
  530. ; additional offsets in a color GrafPort
  531. ;
  532.  
  533. portPixMap        EQU         portBits                  ; [long] pixelMap handle
  534. portVersion       EQU         portPixMap+4              ; [word] port version number
  535. grafVars          EQU         portVersion+2             ; [long] handle to more fields
  536. chExtra           EQU         grafVars+4                ; [word] character extra
  537. pnLocHFrac        EQU         chExtra+2                 ; [word] pen fraction
  538. bkPixPat          EQU         bkPat                     ; [long] handle to bk pattern
  539. rgbFgColor        EQU         bkPixPat+4                ; [6 bytes] RGB components of fg color
  540. rgbBkColor        EQU         rgbFgColor+6              ; [6 bytes] RGB components of bk color
  541. pnPixPat          EQU         pnPat                     ; [long] handle to pen's pattern
  542. fillPixPat        EQU         pnPixPat+4                ; [long] handle to fill pattern 
  543.  
  544. CGrafPort            RECORD  0
  545. device               DS.W    1            ; short
  546. portPixMap           DS.L    1            ; PixMapHandle: port's pixel map
  547. portVersion          DS.W    1            ; short: high 2 bits always set
  548. grafVars             DS.L    1            ; Handle: Handle to more fields
  549. chExtra              DS.W    1            ; short: character extra
  550. pnLocHFrac           DS.W    1            ; short: pen fraction
  551. portRect             DS      Rect
  552. visRgn               DS.L    1            ; RgnHandle
  553. clipRgn              DS.L    1            ; RgnHandle
  554. bkPixPat             DS.L    1            ; PixPatHandle: background pattern
  555. rgbFgColor           DS      RGBColorRec  ;RGB components of fg
  556. rgbBkColor           DS      RGBColorRec  ;RGB components of bk
  557. pnLoc                DS      Point
  558. pnSize               DS      Point
  559. pnMode               DS.W    1            ; short
  560. pnPixPat             DS.L    1            ; PixPatHandle: pen's pattern
  561. fillPixPat           DS.L    1            ; PixPatHandle: fill pattern
  562. pnVis                DS.W    1            ; short
  563. txFont               DS.W    1            ; short
  564. txFace               DS.B    1            ; Style: txFace is unpacked byte  push as short
  565. filler               DS.B    1            ; Byte
  566. txMode               DS.W    1            ; short
  567. txSize               DS.W    1            ; short
  568. spExtra              DS.L    1            ; Fixed
  569. fgColor              DS.L    1            ; long
  570. bkColor              DS.L    1            ; long
  571. colrBit              DS.W    1            ; short
  572. patStretch           DS.W    1            ; short
  573. picSave              DS.L    1            ; Handle
  574. rgnSave              DS.L    1            ; Handle
  575. polySave             DS.L    1            ; Handle
  576. grafProcs            DS.L    1            ; CQDProcsPtr
  577. size                 EQU     *
  578.                      ENDR
  579.  
  580.  
  581.  
  582. ; GDevice field offsets
  583. ;
  584.  
  585. gdRefNum          EQU         $0                        ; [word] unitNum of driver
  586. gdID              EQU         $2                        ; [word] client ID for search procs
  587. gdType            EQU         $4                        ; [word] fixed/CLUT/direct
  588. gdITable          EQU         $6                        ; [long] handle to inverse table
  589. gdResPref         EQU         $A                        ; [word] preferred resolution for inverse tables
  590. gdSearchProc      EQU         $C                        ; [long] search proc (list?) pointer
  591. gdCompProc        EQU         $10                       ; [long] complement proc (list?) pointer
  592. gdFlags           EQU         $14                       ; [word] grafDevice flags word
  593. gdPMap            EQU         $16                       ; [long] handle to pixMap describing device
  594. gdRefCon          EQU         $1A                       ; [long] reference value
  595. gdNextGD          EQU         $1E                       ; [long] handle of next gDevice
  596. gdRect            EQU         $22                       ; [rect] device's bounds in global coordinates
  597. gdMode            EQU         $2A                       ; [long] device's current mode
  598. gdCCBytes         EQU         $2E                       ; [word] depth of expanded cursor data
  599. gdCCDepth         EQU         $30                       ; [word] depth of expanded cursor data
  600. gdCCXData         EQU         $32                       ; [long] handle to cursor's expanded data
  601. gdCCXMask         EQU         $36                       ; [long] handle to cursor's expanded mask
  602. gdReserved        EQU         $3A                       ; [long] MUST BE 0
  603. gdRec             EQU         $3E                       ; size of GrafDevice record
  604.  
  605. GDevice              RECORD  0
  606. gdRefNum             DS.W    1            ; short: driver's unit number
  607. gdID                 DS.W    1            ; short: client ID for search procs
  608. gdType               DS.W    1            ; short: fixed/CLUT/direct
  609. gdITable             DS.L    1            ; ITabHandle: Handle to inverse lookup table
  610. gdResPref            DS.W    1            ; short: preferred resolution of GDITable
  611. gdSearchProc         DS.L    1            ; SProcHndl: search proc list head
  612. gdCompProc           DS.L    1            ; CProcHndl: complement proc list
  613. gdFlags              DS.W    1            ; short: grafDevice flags word
  614. gdPMap               DS.L    1            ; PixMapHandle: describing pixMap
  615. gdRefCon             DS.L    1            ; long: reference value
  616. gdNextGD             DS.L    1            ; GDHandle: GDHandle Handle of next gDevice
  617. gdRect               DS      Rect         ; device's bounds in global coordinates
  618. gdMode               DS.L    1            ; long: device's current mode
  619. gdCCBytes            DS.W    1            ; short: depth of expanded cursor data
  620. gdCCDepth            DS.W    1            ; short: depth of expanded cursor data
  621. gdCCXData            DS.L    1            ; Handle: Handle to cursor's expanded data
  622. gdCCXMask            DS.L    1            ; Handle: Handle to cursor's expanded mask
  623. gdReserved           DS.L    1            ; long: future use. MUST BE 0
  624. size                 EQU     *
  625.                      ENDR
  626.  
  627.  
  628. ; VALUES FOR GDType
  629.  
  630. clutType          EQU         0                         ; 0 if lookup table
  631. fixedType         EQU         1                         ; 1 if fixed table
  632. directType        EQU         2                         ; 2 if direct values
  633.  
  634. ; BIT ASSIGNMENTS FOR GDFlags
  635.  
  636. gdDevType         EQU         0                         ; 0 = monochrome; 1 = color
  637. hasAuxMenuBar    EQU            06                        ; 1 if device has an Aux menu bar on it
  638. BurstDevice        EQU            07                        ; 1 if this device support burst xfer
  639. ext32Device        EQU            08                        ; 1 if this device must be accessed in 32-bit mode
  640. frozenDevice    EQU            09                        ; reserved for future use
  641. ramInit           EQU         10                        ; 1 if initialized from 'scrn' resource
  642. mainScreen        EQU         11                        ; 1 if main screen
  643. allInit           EQU         12                        ; 1 if all devices initialized
  644. screenDevice      EQU         13                        ; 1 if screen device [not used]
  645. noDriver          EQU         14                        ; 1 if no driver for this GDevice
  646. screenActive      EQU         15                        ; 1 if in use
  647.  
  648. ; CCrsr (Color Cursor) field offsets
  649. ;
  650. ; NOTE THAT THE FIRST FOUR FIELDS ARE PARALLEL TO THE FIRST FOUR FIELDS
  651. ; OF A PATTERN SO THAT PATCONVERT CAN BE USED TO EXPAND A CURSOR
  652. ;
  653.  
  654. crsrType          EQU         0                         ;[WORD] CURSOR TYPE
  655. crsrMap           EQU         crsrType+2                ;[LONG] HANDLE TO CURSOR'S PIXMAP
  656. crsrData          EQU         crsrMap+4                 ;[LONG] HANDLE TO CURSOR'S COLOR DATA
  657. crsrXData         EQU         crsrData+4                ;[LONG] HANDLE TO EXPANDED DATA
  658. crsrXValid        EQU         crsrXData+4               ;[WORD] DEPTH OF EXPANDED DATA (0 IF NONE)
  659. crsrXHandle       EQU         crsrXValid+2              ;[LONG] HANDLE FOR FUTURE USE
  660. crsr1Data         EQU         crsrXHandle+4             ;[16 WORDS] ONE-BIT DATA
  661. crsrMask          EQU         crsr1Data+32              ;[16 WORDS] ONE-BIT MASK
  662. crsrHotSpot       EQU         crsrMask+32               ;[POINT] HOT-SPOT FOR CURSOR
  663. crsrXTable        EQU         crsrHotSpot+4             ;[LONG] TABLE ID FOR EXPANDED DATA
  664. crsrID            EQU         crsrXTable+4              ;[LONG] ID FOR CURSOR
  665. crsrRec           EQU         crsrID+4                  ;SIZE OF CURSOR SAVE AREA
  666.  
  667. CCrsr                RECORD  0
  668. crsrType             DS.W    1            ; short: type of cursor
  669. crsrMap              DS.L    1            ; PixMapHandle: the cursor's pixmap
  670. crsrData             DS.L    1            ; Handle: cursor's data
  671. crsrXData            DS.L    1            ; Handle: expanded cursor data
  672. crsrXValid           DS.W    1            ; short: depth of expanded data (0 if none)
  673. crsrXHandle          DS.L    1            ; Handle: future use
  674. crsr1Data            DS.B    32           ; Bits16: one-bit cursor
  675. crsrMask             DS.B    32           ; Bits16: cursor's mask
  676. crsrHotSpot          DS      Point        ;cursor's hotspot
  677. crsrXTable           DS.L    1            ; long: private
  678. crsrID               DS.L    1            ; long: private
  679. size                 EQU     *
  680.                      ENDR
  681.  
  682.  
  683.  
  684. ; CIcon (Color Icon) field offsets
  685. ;
  686.  
  687. iconPMap          EQU         0                         ;[PIXMAP] ICON'S PIXMAP
  688. iconMask          EQU         iconPMap+pmRec            ;[BITMAP] 1-BIT VERSION OF ICON ONE-BIT MASK FOR ICON
  689. iconBMap          EQU         iconMask+bitmapRec        ;[BITMAP] 1-BIT VERSION OF ICON
  690. iconData          EQU         iconBMap+bitmapRec        ;[LONG] HANDLE TO PIXMAP DATA
  691. ;FOLLOWED BY BMAP AND MASK DATA
  692. iconRec           EQU         iconData+4                ;SIZE OF ICON HEADER
  693.  
  694. CIcon                RECORD  0
  695. iconPMap             DS      PixMap       ;the icon's pixMap
  696. iconMask             DS      BitMapRecord ;the icon's mask
  697. iconBMap             DS      BitMapRecord ;the icon's bitMap
  698. iconData             DS.L    1            ; Handle: the icon's data
  699. iconMaskData         DS.W    1            ; Array of short: icon's mask and BitMap data
  700. size                 EQU     *
  701.                      ENDR
  702.  
  703.  
  704. ;
  705. ; Gamma Table format
  706. ;
  707. gVersion          EQU         0                         ; [word] gamma version number
  708. gType             EQU         gVersion+2                ; [word] gamma data type
  709. gFormulaSize      EQU         gType+2                   ; [word] Formula data size
  710. gChanCnt          EQU         gFormulaSize+2            ; [word] number of channels of data
  711. gDataCnt          EQU         gChanCnt+2                ; [word] number of values/channel
  712. gDataWidth        EQU         gDataCnt+2                ; [word] bits/corrected value (data packed to next larger byte size)
  713. gFormulaData      EQU         gDataWidth+2              ; [array] data for formulas, followed by gamma values
  714.  
  715.  
  716. GammaTbl             RECORD  0
  717. gVersion             DS.W    1            ; short: gamma version number
  718. gType                DS.W    1            ; short: gamma data type
  719. gFormulaSize         DS.W    1            ; short: Formula data size
  720. gChanCnt             DS.W    1            ; short: number of channels of data
  721. gDataCnt             DS.W    1            ; short: number of values/channel
  722. gDataWidth           DS.W    1            ; short: bits/corrected value (data packed to next larger byte size)
  723. gFormulaData         DS.W    1            ; Array of short: data for formulas followed by gamma values
  724. size                 EQU     *
  725.                      ENDR
  726.  
  727.  
  728. ; EXTENSIONS TO THE QDPROCS RECORD
  729. ;
  730.  
  731. opcodeProc        EQU         $34                       ; [pointer]
  732. newProc1          EQU         $38                       ; [pointer]
  733. newProc2          EQU         $3C                       ; [pointer]
  734. newProc3          EQU         $40                       ; [pointer]
  735. newProc4          EQU         $44                       ; [pointer]
  736. newProc5          EQU         $48                       ; [pointer]
  737. newProc6          EQU         $4C                       ; [pointer]
  738. cqdProcsRec       EQU         $50                       ; size of QDProcs record
  739.  
  740. ; OFFSETS WITHIN GRAFVARS:
  741. ;
  742. rgbOpColor        EQU         0                         ; [6 bytes] color for addPin, subPin and average
  743. rgbHiliteColor    EQU         rgbOpColor+6              ; [6 bytes] color for hiliting
  744. pmFgColor         EQU         rgbHiliteColor+6          ; [4 bytes] palette handle for foreground color
  745. pmFgIndex         EQU         pmFgColor+4               ; [2 bytes] index value for foreground
  746. pmBkColor         EQU         pmFgIndex+2               ; [4 bytes] palette handle for background color
  747. pmBkIndex         EQU         pmBkColor+4               ; [2 bytes] index value for background
  748. pmFlags           EQU         pmBkIndex+2               ; [2 bytes] flags for Palette Manager
  749. grafVarRec        EQU         pmFlags+2                 ; size of grafVar record
  750.  
  751. GrafVarsRec          RECORD  0
  752. rgbOpColor           DS      RGBColorRec  ;color for addPin  subPin and average
  753. rgbHiliteColor       DS      RGBColorRec  ;color for hiliting
  754. pmFgColor            DS.L    1            ; Handle: palette Handle for foreground color
  755. pmFgIndex            DS.W    1            ; short: index value for foreground
  756. pmBkColor            DS.L    1            ; Handle: palette Handle for background color
  757. pmBkIndex            DS.W    1            ; short: index value for background
  758. pmFlags              DS.W    1            ; short: flags for Palette Manager
  759. size                 EQU     *
  760.                      ENDR
  761.  
  762.  
  763. ; ColorTable field offsets
  764.  
  765. ctSeed            EQU         0                         ; [long] id number for table
  766. transIndex        EQU         ctSeed+4                  ; [word] index of transparent pixel (obsolete)
  767. ctFlags           EQU         ctSeed+4                  ; [word] hibh bit: 0 = PixMap; 1 = device
  768. ctSize            EQU         ctFlags+2                 ; [word] number of entries in CTTable
  769. ctTable           EQU         ctSize+2                  ; [variant] array of color spec
  770. ctRec             EQU         ctTable                   ; size of record without color table
  771. ctEntrySize       EQU         8                         ; size of each entry in table
  772. minSeed           EQU         1023                      ; minimum seed value (< minSeed reserved for rsrc ID's)
  773. protectBit        EQU         7                         ; protect bit in device color table
  774. reserveBit        EQU         6                         ; reserve bit in device color table
  775. invalColReq       EQU         -1                        ; invalid color table request
  776.  
  777. ColorTable           RECORD  0
  778. ctSeed               DS.L    1            ; long: unique identifier for table
  779. ctFlags              DS.W    1            ; short: high bit: 0 = PixMap; 1 = device
  780. ctSize               DS.W    1            ; short: number of entries in CTTable
  781. ctTable              DS.B    8            ; CSpecArray: array [0..0] of ColorSpec
  782. size                 EQU     *
  783.                      ENDR
  784.  
  785.  
  786. ; CProcRec structure
  787.  
  788. nxtComp           EQU         $0                        ;link to next proc [pointer]
  789. compProc          EQU         $4                        ;pointer to routine [pointer]
  790. cProcSize         EQU         8                         ; size of CProcRec
  791.  
  792. CProcRec             RECORD  0
  793. nxtComp              DS.L    1            ; CProcHndl: CProcHndl Handle to next CProcRec
  794. compProc             DS.L    1            ; ColorComplementProcPtr: pointer to complement procedure
  795. size                 EQU     *
  796.                      ENDR
  797.  
  798.  
  799. ; SProcRec structure
  800.  
  801. nxtSrch           EQU         $0                        ;[pointer] link to next proc
  802. srchproc          EQU         $4                        ;[pointer] pointer to routine
  803. sProcSize         EQU         8                         ; size of SProcRec
  804.  
  805. SProcRec             RECORD  0
  806. nxtSrch              DS.L    1            ; Handle: SProcHndl Handle to next SProcRec
  807. srchProc             DS.L    1            ; ColorSearchProcPtr: pointer to search procedure
  808. size                 EQU     *
  809.                      ENDR
  810.  
  811.  
  812. ; request List structure
  813.  
  814. reqLSize          EQU         0                         ; request list size [word]
  815. reqLData          EQU         2                         ; request list data [words]
  816.  
  817.  
  818. ReqListRec           RECORD  0
  819. reqLSize             DS.W    1            ; short: request list size
  820. reqLData             DS.W    1            ; Array of short: request list data
  821. size                 EQU     *
  822.                      ENDR
  823.  
  824.  
  825.     ENDIF    ; ...already included